﻿using System.Collections.Generic;
using Microsoft.Practices.ObjectBuilder2;

namespace UnityDemo.InstanceManagerCode.LifetimeTypes
{
    public class CustomeLifetimeManager : ILifetimePolicy
    {
        private readonly Dictionary<string, object> _intances;

        public CustomeLifetimeManager()
        {
            _intances = new Dictionary<string, object>();
        }

        #region ILifetimePolicy Members

        public object GetValue()
        {
            return _intances[""];
        }

        public void RemoveValue()
        {
            _intances.Remove("");
        }

        public void SetValue(object newValue)
        {
            _intances[""] = newValue;
        }

        #endregion
    }
}